HAL FDCAN migration: List of applicable concepts ¶
This section provides information about the HAL FDCAN applicable architecture concepts.
Concepts for FDCAN ¶
|
Concept |
Description |
|---|---|
|
The initialization has been split into separate init and config functions:
|
|
|
The handle structure has been renamed to
|
|
|
The init structure has been removed and moved into
|
|
|
|
|
|
New APIs are available to get and set FDCAN features. |
|
|
Two functions to set and get user data are available:
|
|
|
Individual callback registration APIs replace global register and unregister functions |
The callback registration is handled by specific functions for each FDCAN event. These functions are used to register callback functions for different FDCAN events. |
|
All hardware macros have been removed from the HAL FDCAN driver, and equivalent services are ensured through the LL APIs. |
|
|
The FDCAN is now managed by five states:
|
|
|
The HAL FDCAN functions were updated to return:
|
|
|
Redesign the error handling mechanisms within the HAL to enhance the detection, reporting, and management of errors. |
|
|
All TypeDef parts of the HAL FDCAN driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The parameters and state are checked using
|
|
|
Provide RTOS-compatible acquire/release bus services for communication peripheral drivers. |
New functions,
|
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including FDCAN instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
|
Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions). |
All HAL FDCAN functions start with
|
Other HAL FDCAN changes ¶
|
Concept |
Consideration |
|---|---|
|
Rework the FDCAN Rx, Tx, and Tx Event headers using union-based bitfield structures for clearer and simplified access. |
Simplify header read/write operations by using unions to overlay raw 64-bit data with structured bitfields, enabling efficient access to individual header elements while maintaining alignment with hardware descriptors. |
|
Rework the interrupt activation/deactivation APIs to harmonize interrupt management by enabling or disabling individual interrupt lines through a unified interface. |
Modify existing interrupt activation functions by splitting the HAL1 API into two separate APIs: one dedicated to individual interrupt source enabling, and another for enabling entire interrupt lines. |
|
Add an API to recover from Bus-Off error by simplifying the recovery process into a single function call. |
Provide
|
|
Rework CCU management |
Rework the calibration sequence to avoid hardware conflicts when multiple FDCAN instances access the shared Clock Calibration Unit (CCU). |
|
Provide to the user the capacity to calculate bit timing through a utility. |
The
|
|
TTCAN is no longer supported. |
All TTCAN-related constants, macros, types, and functions have been removed and are not supported in HAL2. |